<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    *{
        text-align: center;
        margin: 0 auto;
    }
</style>
<body>
<h2>核酸检测系统</h2>
<form th:action="@{/all}" method="get">
    <div>
        <select name="hospitalId">
            <option value="">请选择</option>
            <option th:each="h:${hospitalAll}" th:value="${h.id}" th:text="${h.name}" th:selected="${h.id}==${hospitalId}"></option>
        </select>
        <input type="submit" value="查询">
        <a th:href="@{/toAdd}"><input type="button" value="添加"></a>
    </div>
    <div>
        <table border="1">
            <tr>
                <th>被检测人</th>
                <th>被检测人手机号</th>
                <th>被检测人身份证号</th>
                <th>检测机构</th>
                <th>检测日期</th>
                <th>检测结果</th>
                <th>操作</th>
            </tr>
            <tr th:each="m:${medAll}">
                <td th:text="${m.assayUser}"></td>
                <td th:text="${m.phone}"></td>
                <td th:text="${m.cardNum}"></td>
                <td th:text="${m.hospitalName}"></td>
                <td th:text="${#dates.format(m.assayTime,'yyyy-MM-dd')}"></td>
                <td th:text="${m.assayResult==0 ? '检测中' : '确诊'}"></td>
                <td>
                    <a th:href="@{/updateMedical(id=${m.id})}" onclick="let at = (confirm('请确认该检测者是否确诊?'));return at">确诊</a>
                </td>
            </tr>
        </table>
    </div>
</form>
</body>
<script src="static/jQuery.js"></script>
</html>